<?php

/**
 * Documentosmateria form base class.
 *
 * @method Documentosmateria getObject() Returns the current form's model object
 *
 * @package    ecampus
 * @subpackage form
 * @author     Grupo 608
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseDocumentosmateriaForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_docente'           => new sfWidgetFormInputHidden(),
      'id_curso'             => new sfWidgetFormInputHidden(),
      'id_documento_materia' => new sfWidgetFormInputHidden(),
      'id_materia'           => new sfWidgetFormInputText(),
      'fecha_publicacion'    => new sfWidgetFormDate(),
      'descripcion'          => new sfWidgetFormInputText(),
      'unidad_tematica'      => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id_docente'           => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_docente')), 'empty_value' => $this->getObject()->get('id_docente'), 'required' => false)),
      'id_curso'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_curso')), 'empty_value' => $this->getObject()->get('id_curso'), 'required' => false)),
      'id_documento_materia' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id_documento_materia')), 'empty_value' => $this->getObject()->get('id_documento_materia'), 'required' => false)),
      'id_materia'           => new sfValidatorInteger(array('required' => false)),
      'fecha_publicacion'    => new sfValidatorDate(array('required' => false)),
      'descripcion'          => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'unidad_tematica'      => new sfValidatorString(array('max_length' => 5, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('documentosmateria[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Documentosmateria';
  }

}
